/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Observer_meu_codigo;

/**
 *
 * @author Marcel
 */
public class ConcreteObserver implements Observer {

    public String palavra;
    public ConcreteSubject cs;
    
    public ConcreteObserver (ConcreteSubject cs) {
        this.cs = cs;
        cs.add(this);
    }
    
    @Override
    public void update() {
        palavra = cs.getPalavra();
        falar();
    }
    
    public void falar () {
        System.out.println(palavra);
    }

    
}
